﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
    StorageMonthOutSearchEvent event = (StorageMonthOutSearchEvent)context.getSessionValue("StorageMonthOutSearchEvent");
    ObjectList list = StorageMonthOut.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<%@page import="system.base.StorageMonthOutSrv"%>
<%@page import="java.util.Vector"%>
<%@page import="system.data.StorageMonthOutPageData"%>
<script language=javascript>

var list_code = "listStorageMonthOut";

function doSearch()
{

    SetValue("s_WarehouseCode",GetValue("i_WarehouseCode")); //仓库编码
    SetValue("s_BalanceTime",GetValue("i_Year")); //结算时间
    doCommonSearch();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>








<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域-->


<input type=hidden name="s_WarehouseCode" value="<%=event.getWarehouseCode()%>"> <!--仓库编码-->
<input type=hidden name="s_BalanceTime" value="<%=event.getBalanceTime()%>"> <!--结算时间-->
<%@ include file="/framework/list_head.jsp"%>
<%
String time = event.getBalanceTime();
String year = time.substring(0,4);
%>


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

    <%=uiSearchInputTR%>>
        <%=uiSearchInputTDHead%>>
            仓库选择：
        </td>
        <%=uiSearchInputTDHead%>>
            <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode",event.getWarehouseCode(),false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        </td>       
    </tr>

    <%=uiSearchInputTR%>>
        <%=uiSearchInputTDHead%>>
            选择结算年份：
        </td>
        <%=uiSearchInputTDHead%>>
            <%=SelectManager.viewYearSelect(con,"i_Year",year,false,"","-请选择-","","")%>  
            <input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
        </td>       
    </tr>    

<%=uiSearchEnd%>

<!--列表标题-->
<%
boolean isfirst = false; 
if(String.valueOf(context.getSessionValue("isfirst")) == "true"){
    isfirst = true;
}
%>
<%if(isfirst || year == null || year.equals("0000") || year.equals("")){%>
    <%=UIManager.addListHeadTitle("单一公司年材料费用月统计")%>    
<%}else{%>
    <%=UIManager.addListHeadTitle(Warehouse.getNameByCode(con,event.getWarehouseCode())+"公司"+year+"年材料费用月统计")%>
<%}%>

<!--********************* Part6:List Area ***************-->
<%=uiListStart%>>
<%
    String menu = (String)context.getSessionValue("choice");
    double[] moneys = (double[])context.getSessionValue(menu);
    //boolean isfirst = false;
    //if(String.valueOf(context.getSessionValue("isfirst")) == "true"){
    //    isfirst = true;
    //}
    //String[] warehouseNames = null;
    //if(!isfirst && vec != null && vec.size() > 0){
    if(!isfirst && moneys != null && moneys.length > 0){
        //warehouseNames = StorageMonthOutSrv.getWarehouseNames(vec);//得到仓库;
        //String[] balanceTimes;
        //balanceTimes = StorageMonthOutSrv.getBalanceTimes(warehouseNames[0],vec,event.getBalanceTime());//得到时间
        //if(balanceTimes != null && balanceTimes.length > 0){
            //int size = balanceTimes.length;%>
            
<script language=javascript>
function drawPole(total,table_x,table_y,thickness,table_width,all_width,all_height,table_type,color1,color2){
//参数含义(传递的数组，横坐标，纵坐标，柱子的厚度，柱子的宽度，图表的宽度，图表的高度,图表的类型,图表颜色:浅色调,图表颜色:深色调)
//纯ASP代码生成图表函数1——柱状图
//作者：龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
//本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
//版本2.0 最后修改日期 2003-7-22
//非常感谢您使用这个函数，请您使用和转载时保留版权信息，这是对作者工作的最好的尊重。
//***************************************************************************************
//修改说明：
//    本代码经原作者同意，由 awaysrain（绝对零度）修改为javascript。
//    最后修改日期 2003-9-22，测试环境为IE 6.0.2500.1106
//    因本人水平有限，修改中难免有错误，请大家及时指正。  
//***************************************************************************************
var tmdColor1 = color1
//var tmdColor1 = new Array()
//tmdColor1[0] = "#d1ffd1";
//tmdColor1[1] = "#ffbbbb";
//tmdColor1[2] = "#ffe3bb";
//tmdColor1[3] = "#cff4f3";
//tmdColor1[4] = "#d9d9e5";
//tmdColor1[5] = "#ffc7ab";
//tmdColor1[6] = "#ecffb7";
//tmdColor1[7] = "#d1ffd1";
//tmdColor1[8] = "#ffbbbb";

var tmdColor2 = color2
//var tmdColor2 = new Array();
//tmdColor2[0] = "#00ff00";
//tmdColor2[1] = "#ff0000";
//tmdColor2[2] = "#ff9900";
//tmdColor2[3] = "#33cccc";
//tmdColor2[4] = "#666699";
//tmdColor2[5] = "#993300";
//tmdColor2[6] = "#99cc00";
//tmdColor2[7] = "#00ff00";
//tmdColor2[8] = "#ff0000";
var tb_color = new Array(tmdColor1,tmdColor2);
var line_color = "#69f";
var left_width = 70;
var length = thickness/2;
var total_no = total[0].length;
var temp1 = 0;
var temp2,temp4,temp4;
for(var i = 0;i<total_no;i++)
{
 if(temp1<total[0][i])
 {
  temp1 = total[0][i];
 }
}
temp1 = parseInt(temp1.toString());
if(temp1>9)
{  
 temp2 = temp1.toString().substr(1,1)
 if(temp2>4)
 {
  temp3 = (parseInt((temp1/(Math.pow(10,(temp1.toString().length-1)))).toString())+1)*Math.pow(10,(temp1.toString().length-1));
 }
 else
 {
  temp3 = (parseInt((temp1/(Math.pow(10,(temp1.toString().length-1)))).toString())+0.5)*Math.pow(10,(temp1.toString().length-1));
 } 
} 
else
{
 if(temp1>4)
  temp3 = 10; 
 else 
  temp3 = 5;
}
temp4=temp3
document.write("<!--[if gte vml 1]><v:rect id='_x0000_s1027' alt='' style='position:absolute;left:" + (table_x+left_width) + "px;top:" + table_y + "px;width:" + all_width + "px;height:" + all_height + "px;z-index:-1' fillcolor='#9cf' stroked='f'><v:fill rotate='t' angle='-45' focus='100%' type='gradient'/></v:rect><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width) + "px," + (table_y+all_height) + "px' to='" + (table_x+all_width+left_width) + "px," + (table_y+all_height) + "px'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width) + "px," + table_y + "px' to='" + (table_x+left_width) + "px," + (table_y+all_height) + "px'/><![endif]-->");

switch (table_type)
{
 case "A": 
 
 var table_space = (all_width-table_width*total_no)/total_no;
 document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px,"+ table_y + "px' to='" + (table_x+left_width+length) + "px," + (table_y+all_height-length) + "px' strokecolor='" + line_color + "'/><![endif]-->");
 
 for(var i=0;i<=all_height-1;i+= all_height/5)
 {
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width)+ "px," + (table_y+all_height-length-i) + "px' to='" + (table_x+left_width+length) + "px," + (table_y+all_height-i) +"px' strokecolor='" + line_color + "'/><![endif]-->");
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px," + (table_y+all_height-length-i) + "px' to='" + (table_x+all_width+left_width) + "px," + (table_y+all_height-length-i) + "px' strokecolor='" + line_color + "'/><![endif]-->");
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+(left_width-15)) + "px," + (table_y+i) + "px' to='" + (table_x+left_width) + "px," + (table_y+i) + "px'/><![endif]-->");
  document.write("<!--[if gte vml 1]>");
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + table_x + "px;top:" + (table_y+i) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + temp4 + "</td></tr></table></v:textbox></v:shape><![endif]-->");
  temp4 = temp4-temp3/5;
 }
 for(var i=0;i<total_no;i++)
 {
  
  var temp_space = table_x + left_width + table_space / 2 + table_space * i + table_width * i;  
  document.write("<v:rect id='_x0000_s1025' alt='' style='position:absolute;left:");
  document.write(temp_space);
  document.write("px;top:");
  document.write(table_y + all_height * (1 - (total[0][i] / temp3)));
  document.write("px;width:" + table_width + "px;height:" + all_height * (total[0][i] / temp3) + "px;z-index:1' fillcolor='" + tb_color[1][i] + "'>");
  document.write("<v:fill color2='" + tb_color[0][i] + "' rotate='t' type='gradient'/>")
  document.write("<o:extrusion v:ext='view' backdepth='" + thickness + "pt' color='" + tb_color[1][i] + "' on='t'/>");
  document.write("</v:rect>");
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + temp_space + "px;top:" + (table_y+all_height*(1-(total[0][i]/temp3))-table_width) + "px;width:" + (table_space+15) + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (temp_space-table_space/2) + "px;top:" + (table_y+all_height+1) + "px;width:" + (table_space+table_width) + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[1][i] + "</td></tr></table></v:textbox></v:shape>");
 }
 
 break;
case "B":
 var table_space = (all_height - table_width * total_no) / total_no;
 document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+all_width) + "px," + (table_y+all_height-length) + "px' strokecolor='" + line_color + "'/><![endif]-->");
 for(var i=0;i<=all_width-1;i +=all_width/5)
 {
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+i) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+length+i) + "px," + (table_y+all_height) + "px' strokecolor='" + line_color + "'/><![endif]-->");
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length+i) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+length+i) + "px," + table_y + "px' strokecolor='" + line_color + "'/><![endif]-->");
  document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+i+all_width/5) + "px," + (table_y+all_height) + "px' to='" + (table_x+left_width+i+all_width/5) + "px," + (table_y+all_height+15) + "px'/><![endif]-->");
  document.write("<!--[if gte vml 1]>");
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x+left_width+i+all_width/5-left_width) + "px;top:" + (table_y+all_height) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + temp4 + "</td></tr></table></v:textbox></v:shape><![endif]-->");
  temp4 = temp4 - temp3 / 5;
 }
 
 for(var i=0;i<total_no;i++)
 {
  var temp_space = table_space/2 + table_space * i + table_width * i;
  document.write("<v:rect id='_x0000_s1025' alt='' style='position:absolute;left:");
  document.write(table_x + left_width);
  document.write("px;top:");
  document.write(table_y + temp_space);
  document.write("px;width:" + all_width * (total[0][i] / temp3) + "px;height:" + table_width + "px;z-index:1' fillcolor='" + tb_color[1][i] + "'>");
  document.write("<v:fill color2='" + tb_color[0][i] + "' rotate='t' angle='-90' focus='100%' type='gradient'/>");
  document.write("<o:extrusion v:ext='view' backdepth='" + thickness + "pt' color='" + tb_color[1][i] + "' on='t'/>");
  document.write("</v:rect>");
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x + left_width + all_width * (total[0][i] / temp3) + thickness / 2) + "px;top:" + (table_y + temp_space) + "px;width:" + (table_space + 15) + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");
 
  document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + table_x + "px;top:" + (table_y + temp_space) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
  document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + total[1][i] + "</td></tr></table></v:textbox></v:shape>");
 }
 
 }
}
</script>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:*         { behavior: url(#default#VML) }
o\:*         { behavior: url(#default#VML) }
.shape       { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<script language=javascript>
//=============调用方法=====================
var dataArray = new Array()
dataArray[0]=<%=moneys[0]%>
dataArray[1]=<%=moneys[1]%>
dataArray[2]=<%=moneys[2]%>
dataArray[3]=<%=moneys[3]%>
dataArray[4]=<%=moneys[4]%>
dataArray[5]=<%=moneys[5]%>
dataArray[6]=<%=moneys[6]%>
dataArray[7]=<%=moneys[7]%>
dataArray[8]=<%=moneys[8]%>
dataArray[9]=<%=moneys[9]%>
dataArray[10]=<%=moneys[10]%>
dataArray[11]=<%=moneys[11]%>
var nameArray = new Array()
nameArray[0]="一月"
nameArray[1]="二月"
nameArray[2]="三月"
nameArray[3]="四月"
nameArray[4]="五月"
nameArray[5]="六月"
nameArray[6]="七月"
nameArray[7]="八月"
nameArray[8]="九月"
nameArray[9]="十月"
nameArray[10]="十一月"
nameArray[11]="十二月"
var total= new Array(dataArray,nameArray)

var color1 = new Array();
color1[0] = "#d1ffd1";
color1[1] = "#ffbbbb";
color1[2] = "#ffe3bb";
color1[3] = "#cff4f3";
color1[4] = "#d9d9e5";
color1[5] = "#ffc7ab";
color1[6] = "#ecffb7";
color1[7] = "#ffff99";
color1[8] = "#999999";
color1[9] = "##CC6699";
color1[10] = "##00FFCC";
color1[11] = "#CC3399";

var color2 = new Array();
color2[0] = "#00ff00";
color2[1] = "#ff0000";
color2[2] = "#ff9900";
color2[3] = "#33cccc";
color2[4] = "#666699";
color2[5] = "#993300";
color2[6] = "#99cc00";
color2[7] = "#ffff00";
color2[8] = "#000000";
color2[9] = "##CC0099";
color2[10] = "#0099CC";
color2[11] = "#800040";

drawPole(total,60,200,20,30,600,200,"A",color1,color2);
//drawPole(total,200,320,20,20,400,250,"B",color1,color2);
</script>
</body>
</html>
<%} %>
<%=uiListEnd%>
</form>


<%@ include file="/framework/foot.jsp"%>

<!--
    Author    :Benny
    FileName  :/system/base/StorageMonthOutList.jsp
-->
